package org.study.springboot.service.impl;

import org.springframework.stereotype.Service;
import org.study.springboot.dao.TLimitUpDetailDao;
import org.study.springboot.entity.TLimitUpDetail;
import org.study.springboot.service.TLimitUpDetailService;

import javax.annotation.Resource;

/**
 * (TLimitUpDetail)表服务实现类
 *
 * @author makejava
 * @since 2024-01-09 23:17:01
 */
@Service("tLimitUpDetailService")
public class TLimitUpDetailServiceImpl implements TLimitUpDetailService {
    @Resource
    private TLimitUpDetailDao tLimitUpDetailDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public TLimitUpDetail queryById(String id) {
        return this.tLimitUpDetailDao.queryById(id);
    }

    /**
     * 新增数据
     *
     * @param tLimitUpDetail 实例对象
     * @return 实例对象
     */
    @Override
    public TLimitUpDetail insert(TLimitUpDetail tLimitUpDetail) {
        this.tLimitUpDetailDao.insert(tLimitUpDetail);
        return tLimitUpDetail;
    }

    /**
     * 修改数据
     *
     * @param tLimitUpDetail 实例对象
     * @return 实例对象
     */
    @Override
    public TLimitUpDetail update(TLimitUpDetail tLimitUpDetail) {
        this.tLimitUpDetailDao.update(tLimitUpDetail);
        return this.queryById(tLimitUpDetail.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(String id) {
        return this.tLimitUpDetailDao.deleteById(id) > 0;
    }
}
